home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC Gamer (Italian) 31
/
PC Gamer IT CD 31 1-2.iso
/
DINKDEMO
/
dink101.exe
/
DINK
/
STORY
/
ITEM-PIG.C
< prev
next >
Wrap
Text File
|
1997-10-01
|
2KB
|
113 lines
//item pig food
void use( void )
{
//disallow diagonal punches
if (sp_dir(1, -1) == 1)
sp_dir(1, 2);
if (sp_dir(1, -1) == 3)
sp_dir(1, 2);
if (sp_dir(1, -1) == 7)
sp_dir(1, 8);
if (sp_dir(1, -1) == 9)
sp_dir(1, 8);
&basehit = sp_dir(1, -1);
&basehit += 520;
//520 is the 'base' for the hit animations, we just add
//the direction
sp_seq(1, &basehit);
sp_frame(1, 1); //reset seq to 1st frame
sp_kill_wait(1); //make sure dink will punch right away
sp_nocontrol(1, 1); //dink can't move until anim is done!
wait(250);
playsound(13, 8000,0,0,0);
&mholdx = sp_x(1, -1);
&mholdy = sp_y(1, -1);
if (sp_dir(1, -1) == 4)
{
&mholdy -= 37;
&mholdx -= 50;
&junk = create_sprite(&mholdx, &mholdy, 5, 430, 1);
sp_seq(&junk, 430);
}
if (sp_dir(1, -1) == 6)
{
&mholdy -= 20;
&mholdx += 50;
&junk = create_sprite(&mholdx, &mholdy, 5, 431, 1);
sp_seq(&junk, 431);
}
if (sp_dir(1, -1) == 8)
{
&mholdy -= 50;
&mholdx += 8;
&junk = create_sprite(&mholdx, &mholdy, 5, 430, 1);
sp_seq(&junk, 430);
}
if (sp_dir(1, -1) == 2)
{
// &mholdy += 0;
&mholdx -= 2;
&junk = create_sprite(&mholdx, &mholdy, 5, 431, 1);
sp_seq(&junk, 431);
}
if (&pig_story != 0) return;
if (&player_map == 407)
{
//they are feeding the pigs.. maybe...
&junk = inside_box(&mholdx,&mholdy, 200, 180, 400, 306);
if (&junk == 1)
{
freeze(1);
wait(200);
Say_stop("Come on pigs, eat!", 1);
//lets create the bully, and run his script
&junk = create_sprite(680, 200, 0, 341, 1);
sp_script(&junk, "s1-bul");
}
}
}
void disarm(void)
{
kill_this_task();
}
void arm(void)
{
int &basehit;
int &mholdx;
int &mholdy;
int &junk;
preload_seq(522);
preload_seq(524);
preload_seq(526);
preload_seq(528);
preload_seq(430);
preload_seq(431);
}
void pickup(void)
{
kill_this_task();
}
void drop(void)
{
kill_this_task();
}